import { baseUrlApi, requestClient, type Result } from '#/api/request';

/** 获取列表 */
export const getPage_news = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/homenews'), {
    params,
  });
};

/** 添加 */
export const postPage_news = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/homenews'), data);
};

/** 获取信息 */
export const getPageInfo_news = (data: { id: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/homenews/${data.id}`));
};

/** 编辑 */
export const putPage_news = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/homenews/${data.id}`),
    data,
  );
};

/** 删除 */
export const deletePage_news = (id: number) => {
  return requestClient.delete<Result>(baseUrlApi(`/portal/admin/homenews/${id}`));
};









export const getPage_selling = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/homeselling'), {
    params,
  });
};

/** 添加 */
export const postPage_selling = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/homeselling'), data);
};

/** 获取信息 */
export const getPageInfo_selling = (data: { id: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/homeselling/${data.id}`));
};

/** 编辑 */
export const putPage_selling = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/homeselling/${data.id}`),
    data,
  );
};

/** 删除 */
export const deletePage_selling = (id: number) => {
  return requestClient.delete<Result>(baseUrlApi(`/portal/admin/homeselling/${id}`));
};









export const getPage_smart = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/homesmart'), {
    params,
  });
};

/** 添加 */
export const postPage_smart = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/homesmart'), data);
};

/** 获取信息 */
export const getPageInfo_smart = (data: { id: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/homesmart/${data.id}`));
};

/** 编辑 */
export const putPage_smart = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/homesmart/${data.id}`),
    data,
  );
};

/** 删除 */
export const deletePage_smart = (id: number) => {
  return requestClient.delete<Result>(baseUrlApi(`/portal/admin/homesmart/${id}`));
};







export const getPage_vechile = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/homevechile'), {
    params,
  });
};

/** 添加 */
export const postPage_vechile = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/homevechile'), data);
};

/** 获取信息 */
export const getPageInfo_vechile = (data: { id: number }) => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/homevechile/${data.id}`));
};

/** 编辑 */
export const putPage_vechile = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/portal/admin/homevechile/${data.id}`),
    data,
  );
};

/** 删除 */
export const deletePage_vechile = (id: number) => {
  return requestClient.delete<Result>(baseUrlApi(`/portal/admin/homevechile/${id}`));
};








/** 添加 */
export const postPage_video = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/homevideo'), data);
};

/** 获取信息 */
export const getPageInfo_video = () => {
  return requestClient.get<Result>(baseUrlApi(`/portal/admin/homevideo`));
};